<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="vue/vue.js"></script>
    <title>表达式</title>
</head>

<body>
    <div id="app">
        <display v-bind:post="post"></display>
    </div>
    <script>
        var post = {
            msg: "hi,i am component!",
            title: "Jade Badon shit on"
        }
        Vue.component("display", {
            props: ['post'],
            data: function () {
                return {
                    inner :{
                        msg: "hi,i am component!1111",
                        title: "Jade Badon shit on222"
                    },
                    msg: "hi,i am component!",
                    title: "Jade Badon shit on"
                }
            },
            template: '<button>{{inner.msg}}{{post.title}}</button>'
        })
        var vm = new Vue({
            el: "#app",
            data:{
                post: {
                    msg: "hi,i am component!TTT",
                    title: "Jade Badon shit onTTT"
                }
            }
        })
        var message = "H e l l o"

        var innerVm = new Vue({
            el:""
        })
        var expr = "vm.msg = message.split(' ').reverse().join('==')"
        try {
            var strSplitRes = new Function(("return " + expr))()
            console.log("valid expr " + strSplitRes)
        } catch (e) {
            console.log(e)
        }

        console.log(vm.msg)
    </script>
</body>

</html>